import axios from "~/axios"
import { useCookies } from '@vueuse/integrations/useCookies'
const cookie = useCookies()

//登录信息  /api/user/background-login/    /api/admin/login
export function login(username,password){  
  return axios.post("/api/user/background-login/",{
    username,
    password
  })
}
//获取登录用户信息  /api/admin/getinfo/get_info/
/* export function getinfo(){
  let a = cookie.get('admin-token')
  return axios.get("/api/admin/info",{
    headers : {
      'Authorization': 'jwt ' + a
    }
  })
} */

export function getinfo(){
  return axios.get("/api/user/info/")
}

//修改密码
export function updatepassword(data){
  return axios.post("/api/user/background-edit-password/",data)
}

export function sidemenu(){
  return axios.get("/api/user/menu/")
}